#version 450

#extension GL_ARB_separate_shader_objects : enable

#extension GL_ARB_shading_language_420pack : enable

layout(location = 0) in VS_OUT {
    vec3 position;
    vec3 normal;
}vs_out;

layout(location = 0) out vec4 o_Color;

layout(binding = 1) uniform Light {
    vec4 position;
    vec4 color;
} light;

void main() {
    vec3 lightPos = vec3(light.position);

    float diff = max(dot(lightPos, vs_out.normal), 0.0);
    vec3 diffuse = diff * vec3(0.5,0.5,0.5);//material color

    //vec3 lightDir = normalize(lightPos - vs_out.position);
    //vec3 viewDir = normalize(viewPos - FragPos);
    //vec3 halfwayDir = normalize(lightPos + viewDir);
    // use blinn phong
    //float spec = pow(max(dot(vs_out.normal, halfwayDir), 0.0), 32.0);//32.0 shininess
    //vec3 specular = light.color * spec;

    o_Color = vec4(diffuse, 1.0f);
}
